<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./Promise.js?a=1"></script>
    <script>
        // 1- Promise.reject
        // 不管传入的是什么,返回的都是失败的promise,失败的值为传入的值
        console.log(Promise.reject(1));// 失败,值为1
        console.log(Promise.reject(2));// 失败,值为2

        const p1 = new Promise(resolve=>resolve(100));
        const p2 = Promise.reject(p1);
        p2.catch(reason=>{
            console.log(reason===p1);// true
        })



        // console.log(Promise.reject(new Promise(resolve=>resolve(100))));// 失败,值为new Promise(resolve=>resolve(100)))
        // console.log(Promise.reject(new Promise((resolve,reject)=>reject(80))));// 失败,值为new Promise((resolve,reject)=>reject(80))
        
    </script>
</body>
</html>